package com.ymatou.iapi.godmch.testcase;

import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.common.collect.Lists;
import com.ymatou.iapi.godmch.parameter.CreateCodeBean;
import com.ymatou.iapi.godmch.parameter.applySupplierBean;
import com.ymatou.iapi.godmch.parameter.createIndepMchBean;
import com.ymatou.iapi.godmch.parameter.setConditionMarkupConfigBean;
import com.ymatou.iapi.godmch.parameter.updateConditionMarkupConfigBean;
import com.ymatou.iapi.godmch.service.applySupplierCall;
import com.ymatou.iapi.godmch.service.createIndepMchCall;
import com.ymatou.iapi.godmch.service.updateConditionMarkupConfigCall;
import com.ymatou.mq.admin.parameter.MessageListBean;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.DGUserCallService;
import com.ymttest.business.service.MqQueryCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.database.model.godmch.markup_config_condition;
import com.ymttest.database.model.godmch.markup_config_conditionExample;
import com.ymttest.database.sqlwapper.godmch.markup_config_conditionWapper;
import com.ymttest.utils.TestDataManager;
/**
*修改按条件自动加价规则
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_updateConditionMarkupConfig{
	private static updateConditionMarkupConfigBean bean;
	private static updateConditionMarkupConfigCall call;
	private MqQueryCallService mqQueryCallService=new MqQueryCallService();
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("修改按条件自动加价规则");
	}

	@Before
	public void caseUp() {
		bean=new updateConditionMarkupConfigBean();
		call=new updateConditionMarkupConfigCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(call.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
		
		private markup_config_condition selectConfig(Integer agentId,Integer supplierId,Integer... markupId) throws InterruptedException
		{
			markup_config_conditionWapper markupConfig=new markup_config_conditionWapper();
			markup_config_conditionExample example=new markup_config_conditionExample();
			example.createCriteria().andAgent_idEqualTo(agentId).andSupplier_idEqualTo(supplierId);
			if(markupId.length>0)
				example.createCriteria().andMarkup_idEqualTo(markupId[0]);
			
			example.setOrderByClause(" create_time desc");
			markup_config_condition config=markupConfig.selectByExample(example).get(0);
			return config;
		}
		
		
		private void updateTimeConfig(Integer agentId,Integer supplierId) throws InterruptedException
		{
			   //修改update_time 因为相同的agentid+suppelierId 1分钟内无法修改
			   markup_config_conditionWapper markupConfig=new markup_config_conditionWapper();
			   markup_config_conditionExample example=new markup_config_conditionExample();
			   example.createCriteria().andAgent_idEqualTo(agentId).andSupplier_idEqualTo(supplierId);
			   markup_config_condition config=markupConfig.selectByExample(example).get(0);
			   config.setUpdate_time(Date.from((LocalDateTime.now().plusDays(-1).atZone(ZoneId.systemDefault()).toInstant())));
			   markupConfig.updateByPrimaryKey(config);
		}
		
		
		 /**
	     * 校验数据库
	     * @param Condition_type
	     * @param lstStr
	     * @throws InterruptedException
	     */
		private void check_verify(Integer Condition_type,String lstStr) throws InterruptedException {
			
			markup_config_condition config=selectConfig(bean.getAgentId(),bean.getSupplierId(),bean.getMarkupId());
			
			Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			Logger.verifyEquals(Condition_type, config.getCondition_type(), "验证数据库markup_config_condition表中的Condition_type字段与传入的一致");
			Logger.verifyEquals(bean.getMarkupType(), config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
			Logger.verifyEquals(bean.getPercentage().stripTrailingZeros().toPlainString(), config.getPercentage().stripTrailingZeros().toPlainString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
			Logger.verifyEquals(bean.getDecimalType(), config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");
			
			Logger.verifyEquals(bean.getOnSaleType(), config.getOn_sale_type(), "验证数据库markup_config_condition表中的On_sale_type字段与传入的一致");
			Logger.verifyEquals(bean.getRefreshProduct(), config.getRefresh_product(), "验证数据库markup_config_condition表中的Refresh_product字段与传入的一致");
			Logger.verifyEquals(0, config.getConfig_status(), "验证数据库markup_config_condition表中的Config_status字段与传入的一致");
			Logger.verifyEquals(lstStr, config.getCondition_list(), "验证数据库markup_config_condition表中的Condition_list字段与传入的一致");
		}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_001_1() {
		Logger.start(true,"修改按条件自动加价规则-有变化-发通知");
		try {
           Integer agentId=GodmchManageCallService.createAgent();
           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
			//新增
           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
           //修改时间
           updateTimeConfig(agentId,supplierId);
           markup_config_condition config=selectConfig(agentId,supplierId);
           //修改
           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
		   //品牌
		   bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
		   
		   
		   call.setData(bean);
		   call.callService();			
			
			String str="{\"brand\":["+bean.getBrandList().get(0)+"]}";
			check_verify(5,str);
			
//			//验证发消息总线-新增
//	       // MessageListBean messageListBean=mqQueryCallService.initGodmchManage(String.valueOf(bean.getAgentId()), "set_markupconfig");
//		   MessageListBean messageListBean=mqQueryCallService.initGodmchManage("SetMarkupConfig-"+bean.getAgentId()+"-"+bean.getSupplierId(), "set_markupconfig");
//	       List <Map> mq=mqQueryCallService.GetMqMessage(messageListBean);
//	        if(mq.size()==0){
//				Thread.sleep(5000);
//				mq = MqQueryCallService.GetMqMessage(messageListBean);
//			}
//	        Logger.comment("mq size:"+mq.size());
//	        Logger.verifyEquals(bean.getAgentId(),mq.get(0).get("agentId"), "验证消息总线代理Id AgentId");
//	        Logger.verifyEquals(bean.getSupplierId(),mq.get(0).get("supplierId"), "验证消息总线服务商 SupplierId");
//	        Logger.verifyEquals(2,mq.get(0).get("operateType"), "验证消息总线operateType=2修改自动加价");
	        
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_001_2() {
		Logger.start(true,"修改按条件自动加价规则-无变化-不发通知");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setBrandList(setBean.getBrandList());

			   call.setData(bean);
			   call.callService();			
				
				String str="{\"brand\":["+bean.getBrandList().get(0)+"]}";
				check_verify(5,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_001() {
		Logger.start(true,"修改按条件自动加价规则-品牌没重复-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	   	       bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));

			   call.setData(bean);
			   call.callService();			
				
				String str="{\"brand\":["+bean.getBrandList().get(0)+"]}";
				check_verify(5,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_002() {
		Logger.start(true,"修改按条件自动加价规则-品牌重复-返回失败");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	   	       bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));

			   call.setData(bean);
			   call.callService();
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.callService();
				
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"]}";
			  check_verify(5,str);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_003() {
		Logger.start(true,"修改按条件自动加价规则-分类没重复-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setBrandList(null);
			   
			   call.setData(bean);
			   call.callService();			
				
				String str="{\"category\":["+bean.getCategoryList().get(0)+"]}";
				check_verify(6,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_004() {
		Logger.start(true,"修改按条件自动加价规则-分类重复-返回失败");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setBrandList(null);
			   
			   call.setData(bean);
			   call.callService();	
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.callService();	
				
				String str="{\"category\":["+bean.getCategoryList().get(0)+"]}";
				check_verify(6,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_005() {
		Logger.start(true,"修改按条件自动加价规则-仓库没重复-返回成功");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();			
				
			  String str="{\"depot\":["+bean.getDepotList().get(0)+"]}";
			  check_verify(7,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_006() {
		Logger.start(true,"修改按条件自动加价规则-仓库重复-返回失败");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setBrandList(null);
			    
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.callService();	
				
			  String str="{\"depot\":["+bean.getDepotList().get(0)+"]}";
			  check_verify(7,str);				
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_007() {
		Logger.start(true,"修改按条件自动加价规则-仓库+分类都不存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
			   String str="{\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			   check_verify(4,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_008() {
		Logger.start(true,"修改按条件自动加价规则-仓库+分类,仓库存在,分类不存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setBrandList(null);
			   
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
			   String str="{\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			   check_verify(4,str);
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_009() {
		Logger.start(true,"修改按条件自动加价规则-仓库+分类,仓库不存在,分类存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
			   String str="{\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			   check_verify(4,str);	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_010() {
		Logger.start(true,"修改按条件自动加价规则-仓库+分类都存在-返回失败");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
			   String str="{\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			   check_verify(4,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_011() {
		Logger.start(true,"修改按条件自动加价规则-仓库+品牌都不存在-返回成功");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           //bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(3,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_012() {
		Logger.start(true,"修改按条件自动加价规则-仓库+品牌,仓库存在,品牌不存在-返回成功");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	        //   bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(3,str);				
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_013() {
		Logger.start(true,"修改按条件自动加价规则-仓库+品牌,仓库不存在,品牌存在-返回成功");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	          // bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(3,str);				
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_014() {
		Logger.start(true,"修改按条件自动加价规则-仓库+品牌都存在-返回成功");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	          // bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
				check_verify(3,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_015() {
		Logger.start(true,"修改按条件自动加价规则-分类+品牌都不存在-返回成功");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	          // bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
				String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"]}"; 
				check_verify(2,str);	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_016() {
		Logger.start(true,"修改按条件自动加价规则-分类+品牌,分类存在,品牌不存在-返回成功");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	         //  bean.setBrandList(null);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
				
			 String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"]}"; 
			 check_verify(2,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_017() {
		Logger.start(true,"修改按条件自动加价规则-分类+品牌,分类不存在,品牌存在-返回成功");
		try {
			
		   Integer agentId=GodmchManageCallService.createAgent();
           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
			//新增
           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
           setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
           //修改时间
           updateTimeConfig(agentId,supplierId);
           //查询对象
           markup_config_condition config=selectConfig(agentId,supplierId);
           //修改
           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
           bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
           //bean.setBrandList(null);
           //修改时间
           updateTimeConfig(agentId,supplierId);
		   call.setData(bean);
		   call.callService();	
				
		   String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"]}"; 
			check_verify(2,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_018() {
		Logger.start(true,"修改按条件自动加价规则-分类+品牌都存在-返回成功");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	         //  setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			   String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"]}"; 
				check_verify(2,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_019() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库都不存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);	
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_020() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库,品牌分类不存在,仓库存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			  //  bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_021() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库,分类仓库不存在,品牌存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   // bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_022() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库,分类品牌不存在,仓库存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			    bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			  //  bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_023() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库,品牌不存在,分类仓库存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   // bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_024() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库,仓库不存在,分类品牌存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   // bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_025() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库,分类不存在,仓库品牌存在-返回成功");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
			   // bean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    bean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			   // bean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_026() {
		Logger.start(true,"修改按条件自动加价规则-品牌+分类+仓库,分类仓库品牌都存在-返回失败");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
			    setBean.setBrandList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setCategoryList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
			    setBean.setDepotList(Lists.newArrayList(Integer.parseInt(TestDataManager.getRandomNum(5))));
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			  String str="{\"brand\":["+bean.getBrandList().get(0)+"],\"category\":["+bean.getCategoryList().get(0)+"],\"depot\":["+bean.getDepotList().get(0)+"]}"; 
			  check_verify(1,str);			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_027() {
		Logger.start(true,"修改按条件自动加价规则-加价类型,1按比例加价变为2建议零售价");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setMarkupType(1);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setMarkupType(2);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
					
			    config=selectConfig(bean.getAgentId(),bean.getSupplierId());
			   Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			    Logger.verifyEquals(2, config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
				Logger.verifyEquals("0", config.getPercentage().stripTrailingZeros().toString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
				Logger.verifyEquals(0, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");					
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_028() {
		Logger.start(true,"修改按条件自动加价规则-加价类型,2建议零售价变为3");
		try {
			   Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setMarkupType(2);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setMarkupType(3);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
			   
			   config=selectConfig(bean.getAgentId(),bean.getSupplierId());
			   Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			   Logger.verifyEquals(3, config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
			   Logger.verifyEquals("0", config.getPercentage().stripTrailingZeros().toString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
			   Logger.verifyEquals(0, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_029() {
		Logger.start(true,"修改按条件自动加价规则-加价类型,1建议零售价变为3按比例加价");
		try {
			 Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setMarkupType(1);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setMarkupType(3);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
			   
			   config=selectConfig(bean.getAgentId(),bean.getSupplierId());
			   Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			   Logger.verifyEquals(3, config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
			   Logger.verifyEquals("0", config.getPercentage().stripTrailingZeros().toString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
			   Logger.verifyEquals(0, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_029_1() {
		Logger.start(true,"修改按条件自动加价规则-加价类型,3建议零售价变为1按比例加价");
		try {
			 Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setMarkupType(3);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setMarkupType(1);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();	
			   
			   config=selectConfig(bean.getAgentId(),bean.getSupplierId());
			   Logger.verifyEquals("200", call.getStatusCode1(), "验证status");
			   Logger.verifyEquals(1, config.getMarkup_type(), "验证数据库markup_config_condition表中的Markup_type字段与传入的一致");
			   Logger.verifyEquals(bean.getPercentage().stripTrailingZeros().toString(), config.getPercentage().stripTrailingZeros().toString(), "验证数据库markup_config_condition表中的Percentage字段与传入的一致");
			   Logger.verifyEquals(bean.getDecimalType(), config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_031() {
		Logger.start(true,"修改按条件自动加价规则-加价后小数点类型2保留小数点后1位");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           setBean.setDecimalType(2);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setDecimalType(1);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();		
			
			    config=selectConfig(bean.getAgentId(),bean.getSupplierId());
				Logger.verifyEquals(1, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");	
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_032() {
		Logger.start(true,"修改按条件自动加价规则-加价后小数点类型3保留小数点后2位变为 2：保留小数点后1位");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           bean.setDecimalType(3);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setDecimalType(2);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();		
			
			    config=selectConfig(bean.getAgentId(),bean.getSupplierId());
				Logger.verifyEquals(2, config.getDecimal_type(), "验证数据库markup_config_condition表中的Decimal_type字段与传入的一致");			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_033() {
		Logger.start(true,"修改按条件自动加价规则-上架类型1自动添加到我的店变为2：手动上架到我的店");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           bean.setOnSaleType(1);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setOnSaleType(2);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();			
				config=selectConfig(bean.getAgentId(),bean.getSupplierId());
				Logger.verifyEquals(2, config.getOn_sale_type(), "验证数据库markup_config_condition表中的On_sale_type字段与传入的一致");	
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_034() {
		Logger.start(true,"修改按条件自动加价规则-上架类型2手动上架到我的店变为1：自动添加到我的店");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	           bean.setOnSaleType(2);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	           bean.setOnSaleType(1);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();			
				config=selectConfig(bean.getAgentId(),bean.getSupplierId());
				Logger.verifyEquals(1, config.getOn_sale_type(), "验证数据库markup_config_condition表中的On_sale_type字段与传入的一致");		
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_035() {
		Logger.start(true,"修改按条件自动加价规则-	不覆盖 变为 覆盖已添加的商品价格");
		try {
			Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setRefreshProduct(false);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	            bean.setRefreshProduct(true);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();			
				config=selectConfig(bean.getAgentId(),bean.getSupplierId());
				Logger.verifyEquals(true, config.getRefresh_product(), "验证数据库markup_config_condition表中的Refresh_product字段与传入的一致");			
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_updateConditionMarkupConfig_036() {
		Logger.start(true,"修改按条件自动加价规则-覆盖 变为 不覆盖 已添加的商品价格");
		try {
			  Integer agentId=GodmchManageCallService.createAgent();
	           Integer supplierId=GodmchManageCallService.createApplySupplier().getSupplierId();
				//新增
	           setConditionMarkupConfigBean setBean=GodmchManageCallService.initSetConditionMarkupConfig(agentId,supplierId);
	            bean.setRefreshProduct(true);
	           GodmchManageCallService.setConditionMarkupConfigCall(setBean);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
	           //查询对象
	           markup_config_condition config=selectConfig(agentId,supplierId);
	           //修改
	           bean=GodmchManageCallService.initUpdateConditionMarkupConfig(agentId,supplierId,config.getMarkup_id(),setBean);
	            bean.setRefreshProduct(false);
	           //修改时间
	           updateTimeConfig(agentId,supplierId);
			   call.setData(bean);
			   call.callService();			
				config=selectConfig(bean.getAgentId(),bean.getSupplierId());
				Logger.verifyEquals(false, config.getRefresh_product(), "验证数据库markup_config_condition表中的Refresh_product字段与传入的一致");	
				
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}